package jsd2302.src.File;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Test05 {
    public static void main(String[] args) throws IOException {

        Scanner scan=new Scanner(System.in);

        while (true){
            String name=scan.next();
            File file=new File("./"+name+".txt");
            if (file.exists()) {
                System.out.println("该文件已存在，请重新输入");

            } else {

                file.createNewFile();
                System.out.println("文件已创建");
                break;
            }
         }

    }
}
